Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@d3fc/d3fc-rebind
Advanced tools
Utilities for copying methods from one d3 component to another in a configurable way
Utilities for copying methods from one D3 component to another in a configurable way
npm install @d3fc/d3fc-rebind
# fc.rebind(target, source, ...names)
Provides the same functionality as d3.rebind
-
Copies the methods with the specified
names
fromsource
totarget
, and returnstarget
. Calling one of the named methods on the target object invokes the same-named method on the source object, passing any arguments passed to the target method, and using the source object as the this context. If the source method returns the source object, the target method returns the target object (“setter” method); otherwise, the target method returns the return value of the source method (“getter” mode). The rebind operator allows inherited methods (mix-ins) to be rebound to a subclass on a different object.
# fc.rebindAll(target, source, [...transforms])
Provides the same functionality as rebind
but copies all properties found on source
to target
. Optionally, property name transforms can be specified. These receive a source property name and return either the target property name or a falsey value to indicate the property should not be copied.
N.B. This method does not work with properties found on the source object's prototype e.g. d3.dispatch().on
. If you need this functionality use rebind
.
As well as creating transforms manually, the following may be useful (especially if you're not able to use ES2015 features) -
# fc.exclude(...names)
Exclude a set of property names
. Names can be specified as a string
or RegExp
.
# fc.include(...names)
Include only the set of property names
. Names can be specified as a string
or RegExp
.
# fc.includeMap(mappings)
Include only the set of properties specified by the keys of mappings
using their corresponding values as the target property name e.g. { 'sourceName': 'targetName' }
.
# fc.prefix(str)
Prefix all property names with str
.
FAQs
Utilities for copying methods from one d3 component to another in a configurable way
We found that @d3fc/d3fc-rebind demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.